<div class="cte-harp<?php echo $slots ? '' : ' empty'; ?> cte-<?php echo $name; ?>">
<?php 
echo '<h2>', $def['title'], "</h2>"; 

if (!$slots) {
  ?><p>Klicken Sie rechts auf <em><?php echo $def['title']; ?></em>, um einen neuen Eintrag anzulegen</p>
  <?php  
}
else {
  foreach ($slots as $slot) {
    if (!$slot['enabled']) continue;
    
    $class = 'cte-' . $def['model'] . '-' .  $slot['id'];  
  ?>
  <div class="cte-slot editable" cte:form="<?php echo $name; ?>" cte:id="<?php echo $slot['id']; ?>">
    <div class="left">
      <p class="dates">
        <span class="<?php echo $class; ?>-date_from">
          <?php echo $slot['date_from']; ?>
        </span><?php if ($slot['date_to']) echo ' - '; ?>
        <span class="<?php echo $class; ?>-date_to">
          <?php echo $slot['date_to'] == '0000-00-00' ? 'heute' : $slot['date_to']; ?>
        </span>
      </p>
      <p class="establishment">
        <span class="<?php echo $class; ?>-establishment">
          <?php echo $slot['establishment']; ?>
        </span>
      </p>
    </div>
    <div class="main">
      <h3>
        <span class="<?php echo $class; ?>-title">
          <?php echo $slot['title']; ?>
        </span>
      </h3>
      <p class="body">
        <span class="<?php echo $class; ?>-body">
          <?php echo nl2br($slot['body']); ?>
        </span>
      </p>
      <br class="clear" />
    </div>
  </div>
<?php
  }
}
?>
</div>